September 16 2021
The lab counts for up to 4 points towards the final grade of the course.
Have fun!
We will reproduce the steps for data downloading described in lab 2 but this time, we will download other images. You will also need to copy the compressed (.tar or .tar.gz). For detailed downloading instructions, please refer to the instructions for lab 2.
Go to Earth explorer (http://earthexplorer.usgs.gov). Click on the login link and enter the credentials that you used in class to open an account.
Click on the “Search Criteria” tab, type “Philadelphia” and double click on the suggested location. This will show a pin in the selected location in the map. Zoom to the pin. Then locate Fairmount Park in the map and drag the to an edge of the park. Click on the other edges of the park to produce a polygon as show below:
Click on the “Data Sets” tab at the top of the search panel. Then on the drop down menu select Aerial Imagery/NAIP.
Click on the results tab and locate the NAIP image specified below. If you click on the “Show Footprint” button, you will see in the map that this is the scene that covers most of the park.
. Click on the “Download Options”button" at the bottom of the entity (see instructions for lab 2) and download the full resolution image. The image should download as a compressed file with a .tar.gz extension in the default downloads folder in your computer.
Move the compressed file into the working folder that you will specify as setwd() in R as shown in Part B. Also copy the compressed Landsat image that you used for lab 2 and paste it in the working folder. If you don’t have access to it, you can follow the steps described in lab 2 to download it.
Load required libraries.
library(raster)
library(rgdal)
library(RStoolbox)
wd="/Users/tug61163/Documents/Courses/IntroRemoteSensing/2021Fall/Class3/LabFigures"
setwd(wd)
dir(wd)
untar(paste(wd,"LC08_L1TP_014032_20170612_20170628_01_T1.tar.gz",sep="/"))
L8=stackMeta(paste(wd, "LC08_L1TP_014032_20170612_20170628_01_T1_MTL.txt", sep="/"))
If the stackMeta function doesn’t work, run the dir() function again and copy the names of bands one through seven (you don’t need the others), then paste them separated by commas in the stack() function. This will create a raster stack.
dir(wd)
L8=stack("LC08_L1TP_014032_20170612_20170628_01_T1_B1.TIF",
"LC08_L1TP_014032_20170612_20170628_01_T1_B2.TIF" ,
"LC08_L1TP_014032_20170612_20170628_01_T1_B3.TIF" ,
"LC08_L1TP_014032_20170612_20170628_01_T1_B4.TIF" ,
"LC08_L1TP_014032_20170612_20170628_01_T1_B5.TIF" ,
"LC08_L1TP_014032_20170612_20170628_01_T1_B6.TIF" ,
"LC08_L1TP_014032_20170612_20170628_01_T1_B7.TIF")
unzip("m_3907507_nw_18_060_20191019.zip")
naip=stack("m_3907507_nw_18_060_20191019.tif") # The tif file for NAIP has all the bands already stacked
L8 # Provides the spatial information associated with the downloaded image.
naip # Provides the spatial information associated with the downloaded image.
ggRGB(L8, r = 4, g = 3, b = 2, axes = FALSE, stretch = "lin",
main = "Landsat true Color Composite" )
ggRGB(naip, r = 1, g = 2, b = 3, axes = TRUE, stretch = "lin",
main = "naip true Color Composite" )
L8rsz=crop(L8, naip)
L8agg=aggregate(L8rsz, fact=8)
e=drawExtent()
ggRGB(L8agg, r = 4, g = 3, b = 2, stretch = "lin", ext=e)
ggRGB(L8rsz, r = 4, g = 3, b = 2, stretch = "hist", ext=e)
ggRGB(naip, r = 1, g = 2, b = 3, stretch = "lin", ext=e)
pdf("VGutierrez_Lab3.pdf")
ggRGB(L8agg, r = 4, g = 3, b = 2, stretch = "lin")
ggRGB(L8rsz, r = 4, g = 3, b = 2, stretch = "hist")
ggRGB(naip, r = 1, g = 2, b = 3, stretch = "lin")
dev.off()
You can use the template for lab deliverables available in module 3 in canvas to provide your answers.
Download an NAIP image including the area of Staten Island in NY from August 30 2019 by adapting the steps specified in Part A. Then modify part B to produce three PDF files for the extent of the NAIP image downloaded for Staten Island (1 pt).
Fill up the table below with the information requested. Calculate the number of potential pixel values based on the quantization number using the formula provided in the class presentation. Below are some helpful sources and hints. You can also infer some of the answers from the data you downloaded or the “Show metadata and browse” button associated to each dataset in Earth Explorer (1 pt).
| Characteristic | Landsat 8 | NAIP |
|---|---|---|
| Pixel size | ||
| Sensor revisit time | ||
| number of bands | ||
| quantization | 8 | |
| maximum possible number of pixel values |
Spatial resolution _________________________ Temporal resolution _________________________ Spectral resolution _________________________ Radiomeric resolution _________________________
| Land cover | Landsat 8 aggregated | Landsat 8 | NAIP |
|---|---|---|---|
| Forest | |||
| Road | |||
| Bridge | |||
| River | |||
| Grassland | |||
| Urban | |||
| Suburban |